const calendar = []
let start = Date.now() - 60000 * 60 * 24 * 365;

let total = 366
while (true) {
    calendar.push([])
    for (let j = 0; j < 7; j ++) {
        const d = new Date(start)
        calendar[calendar.length - 1].push({
            count: 0,
            level: 0,
            date: `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}`,
        })
        start += 60000 * 60 * 24;
        total --
        if (total === 0) {
            break;
        }
    }
    if (total === 0) {
        break;
    }
}

module.exports = calendar;